<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 姚波
  Date: 2019/1/24
  Time: 15:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link type="text/css" rel="stylesheet" href="layuiadmin/layui/css/layui.css">
    <script src="layuiadmin/layui/layui.js"></script>
    <script src="js/jquery.min.3.1.0.js"></script>
    <style>
        .cart{
            width: 447px;
            margin-top: 10px;
            float: left;
        }
        .mation{
            width: 223px;
            height: 281px;
            float: right;
            border: 1px solid #cc0000;
        }
        .ids{
            color: rgba(0,0,0,0.0);
        }
        .id2{
            margin-left: 10px;
            margin-top: 10px;
        }
        .money{
            color: #cc0000;
        }
        #frame{
            width: 449px;
            height: auto;
        }
        .layui-icon{
            margin-left: 203px;
            margin-top: 123px;
            cursor: pointer;
        }
        .layui-icon:hover{
            width: 15px;
            height: 15px;
            background: #2b425b;
        }
        body{
           background: #cfffec;
        }
    </style>
</head>
<body>

<div id="frame">
    <c:forEach var="l" items="${rel}">
    <div class="cart">
    <img src="images/${l.goPictureUrl}">
    <div class="mation">
        <p class="ids id2">${l.tableId}</p>
        <p class="id2">${l.goName}</p>
        <p class="id2">${l.goDescribe}</p>
        <p class="id2 money">￥${l.goPrice}</p>
        <p class="layui-icon layui-icon-delete" onclick="deles(${l.tableId},${l.cartId})"></p>
    </div>
    </div>
    </c:forEach>
</div>
<script>
function deles(id,cartId) {

    $.ajax({
        url:"deleteCart?id="+id,   //请求路径
        datatype:"json",//返回的格式
        type:"POST", //什么请求
        success:function (data) { //请求成功以后
           window.location.href="shoppingCart?cartId="+cartId;
        }
    });
}
</script>
</body>
</html>
